<%@ page import="org.ikastola.Fee" %>

<script type="text/javascript">
$(document).ready(function() {
	$("#detailfee").hide();
	$("#adddetail").click(function () {
		if ($(this).is(':checked')) {
			$("#detailfee").show();
			$("#value").val(0);
			$("#value").attr("disabled",true);
		} else {
			$("#detailfee").hide();
			$("#value").attr("disabled",false);
		}
	});
	$("#formaccordion").accordion({
		collapsible: true,
		active: false,
		heightStyle: "content"
	});
});

function submitFeeForm() {
	$("#feeForm").submit();
}

</script>

<div class="fieldcontain ${hasErrors(bean: feeInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="fee.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="name" required="" value="${feeInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: feeInstance, field: 'value', 'error')} required">
	<label for="value">
		<g:message code="fee.value.label" default="Value" />
		<span class="required-indicator">*</span>
	</label>
	<input type="number" name="value" value="${feeInstance?.value}" step="${ikastola.Constants.DOUBLE_STEP}" title="El valor debe comenzar con un n&uacute;mero, usar punto como separador de decimal y redondear a 0.05." id="value"/>
</div>

<div class="fieldcontain ${hasErrors(bean: feeInstance, field: 'description', 'error')} required">
	<label for="description">
		<g:message code="fee.description.label" default="Description" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="description" required="" value="${feeInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: feeInstance, field: 'period', 'error')} ">
	<label for="period">
		<g:message code="fee.period.label" default="Period" />
		
	</label>
	<g:select name="period" from="${feeInstance.constraints.period.inList}" value="${feeInstance?.period}" valueMessagePrefix="fee.period" />
</div>

<div class="fieldcontain ${hasErrors(bean: feeInstance, field: 'duedate', 'error')} ">
	<label for="dueday">
		<g:message code="fee.dueday.label" default="Dueday" />
	</label>
	<g:select name="dueday" from="${feeInstance.constraints.dueday.inList}" value="${feeInstance?.dueday}" />
</div>

